﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microhard.Permission.Interface;
using Microhard.WarehouseInsp.Buz.Models;
using Microhard.WarehouseInsp.Buz.Interfaces;
using Microsoft.Practices.Unity;
using Microhard.Workflow;
using Microhard.WarehouseInsp.Buz.JHWorkflow;
using FluentValidation.Mvc;
using System.IO;
using Microhard.Permission.MVCFilter;
using Microhard.WebUI.Models;
using Microhard.Core;
using Microhard.WarehouseInsp.Buz.Impls;

namespace Microhard.WarehouseInsp.WebUI.Areas.WarehouseInsp.Controllers
{
    public class RiskRecordsController : MicroHardBaseController<RiskRecordsModel>
    {

        private IRiskRecords _resp = null;
        [Dependency]
        public IRiskRecords Category
        {
            set
            {
                base._repository = value;
                _resp = value;
            }
            get
            {
                return _resp;
            }
        }

       

        public ActionResult DownLoadFile(Guid fileID, string fileName)
        {
            IRiskRecords temp = IoC.Resolve<IRiskRecords>();
            byte[] file = temp.DownLoadFile(fileID);

            return File(file, "text/comma-separated-values", fileName); ;
        }
    }
}
